//
//  KVHomeFooterView.swift
//  KVBestMicroblog
//
//  Created by 李康卫 on 16/7/24.
//  Copyright © 2016年 李康卫. All rights reserved.
//

import UIKit

class KVHomeFooterView: UIView {
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
//        self.backgroundColor = UIColor.greenColor()
        //添加子控件
        loadSubView()
    }
    private func loadSubView() {
        //添加子view
        addSubview(retweetBnt)
        addSubview(commentBtn)
        addSubview(likeBtn)
        addSubview(fisrtLine)
        addSubview(seccondLine)
        //转发的约束
        retweetBnt.snp_makeConstraints { (make) -> Void in
            make.top.leading.bottom.equalTo(self)
        }
        //评论
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.equalTo(self)
            make.leading.equalTo(retweetBnt.snp_trailing)
            make.width.equalTo(retweetBnt)
        }
        //like 
        likeBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.equalTo(self)
            make.leading.equalTo(commentBtn.snp_trailing)
            make.trailing.equalTo(self.snp_trailing)
            make.width.equalTo(commentBtn)
        }
        
        //添加分割线
        fisrtLine.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(retweetBnt.snp_trailing)
            make.centerY.equalTo(self)
        }
        seccondLine.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(commentBtn.snp_trailing)
            make.centerY.equalTo(self)
        }
        
    }
    // MARK: -  懒加载子控件
    ///转发timeline_icon_retweet
    private lazy var retweetBnt: UIButton = UIButton(imageName: "timeline_icon_retweet", title: "转发", backgroundName: "timeline_card_bottom_background")
    
    ///评论timeline_icon_comment
    private lazy var commentBtn: UIButton = UIButton(imageName: "timeline_icon_comment", title: "评论", backgroundName: "timeline_card_bottom_background")

    ///评论timeline_icon_unlike
    private lazy var likeBtn: UIButton = UIButton(imageName: "timeline_icon_unlike", title: "赞", backgroundName: "timeline_card_bottom_background")
    
    //分割线timeline_card_bottom_line
    private lazy var fisrtLine: UIImageView = UIImageView.init(image: UIImage(named: "timeline_card_bottom_line"))
     private lazy var seccondLine: UIImageView = UIImageView.init(image: UIImage(named: "timeline_card_bottom_line"))
}
